import request from "../utils/request";

const prefix="/file-service/file"

export function uploadResource(param,onUploadProgress){
    return request({
        url: prefix.concat("/res/upload"),
        method: 'post',
        headers:{'Content-Type':'multipart/form-data'},
        data:param,
        onUploadProgress:onUploadProgress
    })
}

export function uploadImage(param){
    return request({
        url: prefix.concat("/img/upload"),
        method: 'post',
        headers:{'Content-Type':'multipart/form-data'},
        data:param
    })
}
export function getFileServer() {
    return request({
        url: prefix.concat("/url"),
        method: 'get'
    })
}
export function deleteResource(id,type) {
    return request({
        url: prefix.concat("/delete"),
        method:'post',
        params:{
            id:id,
            type:type
        }
    })
}
